package com.daocao.jy.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

/**
 * Created by Administrator on 2016/6/7 0007.
 */
public class HomeViewPager extends ViewPager {
    private boolean setTouchMode = false;
    public HomeViewPager(Context context) {
        super(context);
    }
    public HomeViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        if(setTouchMode)
            return super.onTouchEvent(ev);
        else
            return false;
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (setTouchMode)
            return super.onInterceptTouchEvent(ev);
        else
            return false;
    }
}
